package cn.meibang.aggragation;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.apestar.core.base.MapperAnnotation;
import cn.apestar.core.database.BaseMapper;

@Configuration
public class MapperConfig {

    @Bean(name = "mapperScannerConfigurerNto")
    public MapperScannerConfigurer mapperScannerConfigurer() throws Exception {

        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setMarkerInterface(BaseMapper.class);
        mapperScannerConfigurer.setAnnotationClass(MapperAnnotation.class);
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactoryBean");
        mapperScannerConfigurer.setBasePackage("cn");
        return mapperScannerConfigurer;
    }

}
